package jin.si.com.web;

import jin.si.com.entity.User;

/**
 * @description:
 * @ClassName a
 * @Author MT
 * @Date 2021/7/4 9:06
 **/
public class a implements Comparable{

    private int age;
    private String name;

    public a(int age,String name) {
        this.age=age;
        this.name=name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int compareTo(Object o) {
        a u= (a) o;
        int result=0;
        result=this.age-u.getAge();
        if(result==0){
            result=this.name.compareTo(u.getName());
        }

        return result;
    }



}
